import http from "@/utils/request"
//获取充值的产品

export let getCategoryApi = () => http.get("/product/get_product", {
    params: {
        category_id: '20210827165510715'
    }
})

//下单

export let preOrderApi = (product_id, quantity) => http.post("/order/pre_order", {
    product_id,
    quantity
})


//发起支付

export let paymentApi = (order_id) => http.post("/pay/payment", { order_id })

//查询支付结果

export let queryPayStatusApi = (order_id) => http.get("/order/query_order_status", {
    params: {
        order_id
    }
})

//获取订单

export let getOrderApi = (order_id = "") => http.post('/order/get_order', { order_id })

//删除订单

export let delOrderApi = (order_id = "") => http.get("/order/del_order", { params: { order_id } })